package xyz.lne.researchgroupmanage.service;

import xyz.lne.researchgroupmanage.controller.request.ResearchRequest;
import xyz.lne.researchgroupmanage.controller.request.UserApplyResearchRequest;
import xyz.lne.researchgroupmanage.controller.response.*;
import xyz.lne.researchgroupmanage.entity.Research;
import com.baomidou.mybatisplus.extension.service.IService;
import xyz.lne.researchgroupmanage.service.dataTransferObject.ResearchDTO;
import xyz.lne.researchgroupmanage.service.dataTransferObject.ResearchSimpleDTO;
import xyz.lne.researchgroupmanage.service.dataTransferObject.UserResearchDTO;

import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author team7
 * @since 2021-01-19
 */
public interface ResearchService extends IService<Research> {

    /**
     * @return List<ResearchSimpleDTO>
     * 查找所有的课题信息
     */
    List<ResearchSimpleDTO> findAllResearch();

    /**
     * @param userId
     * @return List<ResearchSimpleDTO>
     * 通过管理者id寻找所有的课题信息
     */
    List<ResearchSimpleDTO> findResearchBymanagerId(Integer userId);


    /**
     * @param userId
     * @return List<ResearchSimpleDTO>
     * 通过加入课题的用户id寻找所有课题信息
     */
    List<ResearchSimpleDTO> findResearchByuserId(Integer userId);

    /**
     * @param ResearchGroupId
     * @return List<ResearchSimpleDTO>
     * 通过加入的课题组id寻找所有课题信息
     */
    List<ResearchSimpleDTO> findResearchByResearchGroupId(Integer ResearchGroupId);


    /**
     * @param researchId
     * @return ResearchSimpleDTO
     * 通过课题id获取课题简要信息
     */
    ResearchSimpleDTO findSimpleResearchById(Integer researchId);

    /**
     * @param researchId
     * @return ResearchDTO
     * 通过课题id获取课题信息
     */
    ResearchDTO findResearchNormalById(Integer researchId);

    /**
     * @param research
     * @return ResearchDTO
     * 增添课题
     */
    ResearchDTO addResearch(Research research);

    /**
     * @param research
     * @return ResearchDTO
     * 更新课题
     */
    ResearchDTO updateResearch(Research research);

    /**
     * 根据关键词搜索课题
     * @param Keyword
     * @return
     */
    List<ResearchSimpleDTO> findResearchByKeyword(String Keyword);

    /**
     * @param researchId
     * @return List<UserResearchDTO>
     * 获取加入课题的所有成员课题信息
     */
    List<UserResearchDTO> findAllResearchUsers(Integer researchId);


    /**
     * @param userId, researchId, remark
     * @return UserResearchDTO
     * 用户申请加入课题操作
     */
    UserResearchDTO userApplyResearch(Integer userId, Integer researchId, String remark);

    /**
     * @param researchId
     */
    Boolean deleteResearch(Integer researchId);


}
